﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Salient.Web.Administration.AppConfig
{
    public partial class AppSetting : WebAdminUserControl
    {
        public CustomValidator CustomValidator
        {
            get
            {
                return CustomVal;
            }
        }

        public bool InEditMode
        {
            get
            {
                return !NameTextBox.Enabled;
            }
            set
            {
                NameTextBox.Enabled = !value;
            }
        }

        public String Name
        {
            get
            {
                return NameTextBox.Text;
            }
            set
            {
                NameTextBox.Text = value;
            }
        }

        public String Value
        {
            get
            {
                return ValueTextBox.Text;
            }
            set
            {
                ValueTextBox.Text = value;
            }
        }

        public event EventHandler Save
        {
            add
            {
                SaveButton.Click += value;
            }
            remove
            {
                SaveButton.Click -= value;
            }
        }

        public void ResetUI()
        {
            NameTextBox.Text = null;
            ValueTextBox.Text = null;
        }

    }
}